package com.example.demo.controller;

import com.example.demo.pojo.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class UserController {

    @GetMapping("/hello")
    public String hello(){
        return "hello,word";
    }

    @GetMapping("/users")
    public List<User> users(){
        User user = new User();
        user.setName("张三");
        user.setAge(18);
        user.setSex("男");
        ArrayList<User> list = new ArrayList<>();
        list.add(user);
        return list;
    }
}
